var express = require('express');
var router = express.Router();
let { OrderModel } = require('../../model/model.js')
/* GET home page. */
router.get('/addorder', async (req, res) => {
  await OrderModel.create(req.query)
  res.send({
    code: 200,
    msg: '添加成功'
  })
})

router.get('/listorder', async (req, res) => {
  let data = await OrderModel.find()
  console.log(data);

  res.send({
    code: 200,
    data: data,
    mag: '展示成功'
  })
})


module.exports = router;
